;; 增强 Emacs 的编辑功能
(require 'init-package)

;; expand-region 智能标记选择区
(when (maybe-require-package 'expand-region)
  (autoload 'er/expand-region "expand-region"
    "Minor mode for region" t)
  (global-set-key (kbd "C-=") 'er/expand-region)
  )

;; iedit
(when (maybe-require-package 'iedit)
  ;;(global-unset-key (kbd "M-m"))
  (require 'init-keybind)
  (define-key my-leader-key "m" 'iedit-mode)
  )

;; multiple-cursors 多点编辑
(when (maybe-require-package 'multiple-cursors)
  (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
  (global-set-key (kbd "C->") 'mc/mark-next-like-this)
  (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
  (global-unset-key (kbd "M-<down-mouse-1>"))
  (global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click))

(provide 'init-edit)
